package cn.duli.xianer.service.impl;

import cn.duli.xianer.dao.NoticeMapper;
import cn.duli.xianer.pojo.Notice;
import cn.duli.xianer.service.NoticeService;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class NoticeServiceImpl implements NoticeService {

    @Resource
    private NoticeMapper noticeMapper;

    @Override
    public int save(Notice notice) {
         noticeMapper.save(notice);
         return notice.getnId();
    }

    @Override
    public void updatePubTime(Notice notice) {
        noticeMapper.updatePubTime(notice);
    }

    @Override
    public Notice findById(Integer nId) {
        return noticeMapper.findById(nId);
    }

    @Override
    public void update(Notice notice) {
        noticeMapper.update(notice);
    }

    @Override
    public void deleteById(Integer nId) {
        noticeMapper.deleteById(nId);
    }

    @Override
    public Page<Notice> findAll() {
        return noticeMapper.findAll();
    }
}
